<extend name='Public/base'/>

<block name='body'>	
	<div class='main-tile'>
		<h2>图文列表</h2>
	</div>
	<div class='cf'>
		<!-- 按钮工具栏 -->
		<div class='f1'>
			<a class='btn' href="{:U('Custom/add')}">添加</a>
			<button class="btn ajax-post confirm" url="{:U('del')}" target-form="ids">删 除</button>
		</div>
		<div class='data-table'>
			<table class="">
				<thead>
					<tr>
						<th class="">编号</th>
						<th class="">图文标题</th>
                        <th class="">添加时间</th>
						<th style='text-align:center'>查看</th>
					</tr>
				</thead>
				<tbody>
					<volist name='list' id='vo'>
						<tr>
							<td>{$vo.id}</td>
							<td>{$vo.title}</td>
                            <td>{$vo.create_time|time_format='Y-m-d'}</td>
							<td style='text-align:center'><a href="{:U('Custom/edit?id='.$vo['id'])}">编辑</a>
                                <a class="confirm ajax-get" href="{:U('Custom/del?ids='.$vo['id'])}">删除</a>
							</td>
						</tr>
					</volist>
				</tbody>
			</table>
		</div>
	</div>
	<div class="page">
        {$_page}
    </div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <script type="text/javascript">
        //搜索功能
        $("#search").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            window.location.href = url;
        });
        /* 状态搜索子菜单 */
        $(".search-form").find(".drop-down").hover(function(){
            $("#sub-sch-menu").removeClass("hidden");
        },function(){
            $("#sub-sch-menu").addClass("hidden");
        });
        $("#sub-sch-menu li").find("a").each(function(){
            $(this).click(function(){
                var text = $(this).text();
                $("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
                $("#sub-sch-menu").addClass("hidden");
            })
        });
        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        highlight_subnav('{:U('Custom/index')}');
    </script>
</block>
